/*
 * @Author: Quinn
 * @Date: 2023-05-13 14:36:43
 * @LastEditors: 叽歪小Q
 * @Description:
 */
import store from "@/store/index";
import quinn from "../utils/quinn";

let menus = [
  {
    path: "/home",
    name: "Home",
    meta: { title: "首页", icon: "el-icon-s-home" },
    component: () => import("@/views/System/home.vue"),
  },
  {
    path: "/OrderManage",
    name: "OrderManage",
    meta: { title: "订单列表", icon: "el-icon-s-order", authority: 299 },
    component: () => import("@/views/Pages/OrderManage.vue"),
  },
  {
    path: "/OrderWarehouse",
    name: "OrderWarehouse",
    meta: { title: "仓库订单列表", icon: "el-icon-s-shop", authority: 298 },
    component: () => import("@/views/Pages/OrderWarehouse.vue"),
  },
  {
    path: "/OrderAftersale",
    name: "OrderAftersale",
    meta: { title: "售后列表", icon: "el-icon-s-marketing", authority: 297 },
    component: () => import("@/views/Pages/OrderAftersale.vue"),
  }, {
    path: "/FactoryInventory",
    name: "FactoryInventory",
    meta: { title: "工厂库存", icon: "el-icon-s-goods", authority: 301 },
    // meta: { title: "工厂库存", icon: "el-icon-s-goods", authority: 300 },
    component: () => import("@/views/Pages/FactoryInventory.vue"),
  }, {
    path: "/purchaseList",
    name: "purchaseList",
    meta: { title: "采购单列表", icon: "el-icon-s-goods", authority: 302 },
    // meta: { title: "采购单列表", icon: "el-icon-s-goods", authority: 315 },
    component: () => import("@/views/Pages/purchaseList.vue"),
  },
  {
    path: "/outportSingle",
    name: "outportSingle",
    meta: { title: "单品出库", icon: "el-icon-s-marketing", authority: 305 },
    component: () => import("@/views/Pages/OutportSingle.vue"),
  },
  {
    path: "/AdjustGoods",
    name: "AdjustGoods",
    meta: { title: "调货列表", icon: "el-icon-s-order", authority: 305 },
    component: () => import("@/views/Pages/AdjustGoods.vue"),
  }, {
    path: "/checkList",
    name: "CheckList",
    meta: { title: "盘点列表", icon: "el-icon-s-order", authority: 306 },
    component: () => import("@/views/Pages/checkList.vue"),
  },
  // {
  // 	path: "/OrderInstall",
  // 	name: "OrderInstall",
  // 	meta: { title: "安装列表", icon: "el-icon-s-shop" },
  // 	component: () => import("@/views/Pages/OrderInstall.vue"),
  // },
  // {
  // 	path: "/OrderFlow",
  // 	name: "OrderFlow",
  // 	meta: { title: "变更记录", icon: "el-icon-s-operation" },
  // 	component: () => import("@/views/Pages/OrderFlow.vue"),
  // },

  {
    path: "/finance",
    meta: { title: "财务管理", icon: "el-icon-s-finance", authority: 188 },
    children: [
      // {
      //   path: "/FinanceTodo",
      //   name: "FinanceTodo",
      //   meta: { title: "待处理", authority: 187 },
      //   component: () => import("@/views/Pages/finance/FinanceTodo.vue"),
      // },
      // {
      //   path: "/FinanceDone",
      //   name: "FinanceDone",
      //   meta: { title: "已付款", authority: 186 },
      //   component: () => import("@/views/Pages/finance/FinanceDone.vue"),
      // },
      // {
      //   path: "/FinanceRefuse",
      //   name: "FinanceRefuse",
      //   meta: { title: "已驳回", authority: 185 },
      //   component: () => import("@/views/Pages/finance/FinanceRefuse.vue"),
      // },
      // {
      //   path: "/FinanceReject",
      //   name: "FinanceReject",
      //   meta: { title: "个人驳回列表", authority: 178 },
      //   component: () => import("@/views/Pages/finance/FinanceReject.vue"),
      // },
      {
        path: "/StoreLedger",
        name: "StoreLedger",
        meta: { title: "品牌方台账", authority: 176 },
        component: () => import("@/views/Pages/finance/StoreLedger.vue"),
      },
      {
        path: "/AreaLedger",
        name: "AreaLedger",
        meta: { title: "仓库方台账", authority: 175 },
        component: () => import("@/views/Pages/finance/AreaLedger.vue"),
      },
    ],
  },
  {
    path: "/inventory",
    meta: { title: "库存管理", icon: "el-icon-s-data", authority: 190 },
    children: [
      {
        path: "/ClassifyManage",
        name: "ClassifyManage",
        meta: { title: "套件管理", authority: 198 },
        component: () => import("@/views/Pages/ClassifyManage.vue"),
      },
      {
        path: "/ProductManage",
        name: "ProductManage",
        meta: { title: "产品管理", authority: 197 },
        component: () => import("@/views/Pages/ProductManage.vue"),
      },
      {
        path: "/InventoryWarn",
        name: "InventoryWarn",
        meta: { title: "库存警告" },
        component: () => import("@/views/Pages/InventoryWarn.vue"),
      },
      {
        path: "/InventoryDetail",
        name: "InventoryDetail",
        meta: { title: "库存明细" },
        component: () => import("@/views/Pages/InventoryDetail.vue"),
      },
      {
        path: "/mobileList",
        name: "mobileList",
        meta: { title: "库存预警" },
        component: () => import("@/views/Pages/MobileList.vue"),
      },
      // {
      //   path: "/InventoryChange",
      //   name: "InventoryChange",
      //   meta: { title: "库存变更",icon:'el-icon-s-data'},
      //   component: () => import("@/views/Pages/InventoryChange.vue"),
      // },
      {
        path: "/InventoryRecord",
        name: "InventoryRecord",
        meta: { title: "出入库记录" },
        component: () => import("@/views/Pages/InventoryRecord.vue"),
      },
    ],
  },
  {
    path: "/team",
    meta: {
      title: "团队管理",
      icon: "el-icon-user-solid",
      authority: 189,
    },
    children: [
      {
        path: "/AccountManage",
        name: "AccountManage",
        meta: { title: "人员管理" },
        component: () => import("@/views/Pages/AccountManage.vue"),
      },
      ...(window.location.href.includes("debug")
        ? [
          {
            path: "/RoleManage",
            name: "RoleManage",
            meta: { title: "角色管理" },
            component: () => import("@/views/Pages/RoleManage.vue"),
          },
        ]
        : []),
    ],
  },
];

const routes = [];
menus.forEach((menu) => {
  if (menu.children) {
    menu.children.forEach((item) => routes.push(item));
  } else routes.push(menu);
});

export const menuRoutes = routes;

export default menus;
